package IO;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Vector;
import data.Show;

public class Save 
{
	
	public static void saveShows(Vector<Show> showList) throws IOException
	{
		Save.saveShows(showList,"shows");
	}
	
	public static void saveShows(Vector<Show> showList, String fileName) throws IOException
	{
		
		String showsFile = SystemInfo.getApplicationDirectory() + fileName + ".ssf";//*.ssf = Show Storage File
		
		File file = new File(showsFile);
		if(!file.exists())
		{
			file.createNewFile();
		}
		
		FileOutputStream fos = new FileOutputStream (showsFile);

		ObjectOutputStream oos = new ObjectOutputStream(fos);
		oos.writeObject(showList);
		fos.close();
	}
}
